<?php $this->load->view('header_view')?>

<div id="main">
    	<?php foreach ($product_info as $row) { ?>
    		<div class="subcolumns">
            	<div class="subcolumns">
					<div class="c80l">
                        <div class="ads_title">
                            <h2><?php echo $row['c_name'].' - '.$row['d_name'].' : '.$row['title']?></h2>
                        </div>
                        <div class="ads_location">
                            Dia chi: <?php echo $row['address']?> 
                            <a href="javascript:;" id="show_on_map" name="show_on_map">Map</a> | 
                            <?php echo anchor('home/detail'.'/'.$row['id'],'detail');?>
                            <input type="hidden" id="tf_geo_location" name="tf_geo_location" value="<?php echo $row['geo_location']?>">
                            <br />
                            Phone: <?php echo $row['phone']?>
                        </div>
                    </div>
                    <div class="c19r">
                        <div class="subcr">
                        	Giam
                            <?php 
								if ($row['price']!=0) {
									echo round((($row['price']-$row['price_discount'])/$row['price']*100),2).' % ';	
								}
							?>
                        </div>
                    </div>
                </div>
                <br>
                <div class="subcolumns">
                    <div class="c33l">
                        <div class="subcolums">
							<?php echo anchor(base_url().'order/index/'.$row['id'].'.html','Dat mua')?>
                            : <?php echo $row['price_discount'] . ' VND'?>
                        </div>
                        <div class="subcolums">
                        	<div class="c33l">
                            	Gia goc: <br>
								<?php echo $row['price'] ?>
                            </div>
                            <div class="c33l">
                            	Giam gia: <br>
								<?php 
									if ($row['price']!=0) {
										echo round((($row['price']-$row['price_discount'])/$row['price']*100),2).' % ';	
									}
								?>
                            </div>
                            <div class="c33r">
                            	Tiet kiem: <br>
								<?php echo ($row['price']-$row['price_discount']. ' VND') ?>
                            </div>
                        </div>
                        <div class="subcolumns">
                        	<div class="subc">
                            	<span time="<?php echo strtotime($row['date_end'])?>" class="kkcount-down"></span>
                            </div>
                            <div class="subc">
								Thoi han mua se ket thuc luc: <?php echo date('h:i:s d/m/Y',strtotime($row['date_end']))?>
                            </div>
						</div>
                        <div class="subcolumns">
                        	<div class="subc">
                            	Chi con 10 phieu / tong so <?php echo $row['quantity']?> phieu
                            </div>
						</div>
                        <div class="subcolumns">
                        	<div class="subc">
                            	So nguoi da thanh toan: 10 nguoi
                            </div>
						</div>
                    </div>
                    <div class="c50r">
                    	<div class="subcolums">
                        	<div id="slideshow">
                                <?php
									if ($row['image']) {
										foreach ($row['image'] as $key => $value) {
											echo '<img width="400px" height="150px" src="'.base_url().'images/upload/'.$value['uri_path'].'" alt="" '.(($key==0)?'class="active"':'').' />';			
										}		
									}
								?>
                            </div>
                        </div>
                        <div class="subcolums">
                        	<div class="c100">
                            	<?php echo $row['condition'] ?>
                            </div>
                        </div>
                    </div>
           	 	</div>
                
            </div>
	    <?php }?>
	<span style="display:inline-block; float:right"><?php echo $paging?></span>        
</div>

<?php $this->load->view('footer_view')?>